package hk.com.fgoproduction.getdroplets.Lib.Common.ToolInstance

import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import android.support.v4.app.ActivityCompat

object RuntimePermissions {

    fun shouldAskForPermissions(context: Context, perm: String): Boolean {
        val flagSDK = Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1
        val flagGranted = ActivityCompat.checkSelfPermission(context, perm) != PackageManager.PERMISSION_GRANTED
        return flagSDK && flagGranted
    }
}